///**
// * Copyright 2018 东方金信
// * <p>
// * Licensed under the Apache License, Version 2.0 (the "License"); you may not
// * use this file except in compliance with the License. You may obtain a copy of
// * the License at
// * <p>
// * http://www.apache.org/licenses/LICENSE-2.0
// * <p>
// * Unless required by applicable law or agreed to in writing, software
// * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// * License for the specific language governing permissions and limitations under
// * the License.
// */
//
//package io.dfjx.common.config;
//
//import javax.servlet.DispatcherType;
//
//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
//import org.springframework.boot.web.servlet.FilterRegistrationBean;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.filter.DelegatingFilterProxy;
//
//
//
///**
// * Filter配置
// *
// * @author Mark sunlightcs@gmail.com
// * @since 2.1.0 2017-04-21
// */
//@Configuration
//@ConditionalOnProperty(prefix = "ca", name = "valid", havingValue = "true", matchIfMissing = true)
//public class FilterConfig {
//
//    @Bean
//    public FilterRegistrationBean shiroFilterRegistration() {
//        FilterRegistrationBean registration = new FilterRegistrationBean();
//        registration.setFilter(new DelegatingFilterProxy("shiroFilter"));
//        //该值缺省为false，表示生命周期由SpringApplicationContext管理，设置为true则表示由ServletContainer管理
//        registration.addInitParameter("targetFilterLifecycle", "true");
//        registration.setEnabled(true);
//        registration.setOrder(Integer.MAX_VALUE - 1);
//        registration.addUrlPatterns("/*");
//        return registration;
//    }
//
////    @Bean
////    public FilterRegistrationBean xssFilterRegistration() {
////        FilterRegistrationBean registration = new FilterRegistrationBean();
////        registration.setDispatcherTypes(DispatcherType.REQUEST);
////        registration.setFilter(new XssFilter());
////        registration.addUrlPatterns("/*");
////        registration.setName("xssFilter");
////        registration.setOrder(Integer.MAX_VALUE);
////        return registration;
////    }
//
//    @Bean
//    public FilterRegistrationBean govFilterRegistration(){
//        FilterRegistrationBean registration = new FilterRegistrationBean();
//        registration.setDispatcherTypes(DispatcherType.REQUEST);
//        registration.setFilter(new GovCaFilter());
//        registration.addUrlPatterns("/");
//        registration.setName("jxetlFilter");
//        registration.setOrder(Integer.MIN_VALUE);
//        return registration;
//    }
//}
